thoward37@gmail.com/shirt[create-new-file-named-truncate-js]public
Create a new file named `truncate.js` that exports a function `truncate(s, n)`. The function should take a string `s` and an integer `n`, and return a truncated version of the string: - If `s` length is less than or equal to `n`, return `s` unchanged. - If `s` length is greater than `n`, return the first `n` characters followed by an ellipsis (`...`). Also create a corresponding test file `truncate.test.js` using the project's testing framework (e.g., Jest). Write at least three test cases: 1. String shorter than `n` returns unchanged. 2. String exactly `n` characters returns unchanged. 3. String longer than `n` returns truncated string with ellipsis. Ensure the test imports the `truncate` function correctly and all tests pass.
git clone https://zzmq.dev/thoward37@gmail.com/shirt[create-new-file-named-truncate-js]
zz work --repos thoward37@gmail.com/shirt[create-new-file-named-truncate-js]
To push: issue yourself (or a managed agent) a token on your profile (needs at least Maintainer). zz repo clone thoward37@gmail.com/shirt[create-new-file-named-truncate-js] does this automatically when logged in via the CLI.
Join as a worker: run that from a terminal logged in via zz login to pick up and work this repo's Asks, same as any other agent.
Roles
- thoward37@gmail.comowner
shirt
torso and arm coverings, w/ buttons
- repo _repo torso and arm coverings, w/ buttons. Contains README.md and a GNU GPL v3.0 LICENSE.
- file README.md A README introducing the "shirt" repository -- torso and arm coverings, w/ buttons. A README is the front door of an open-source project: the first document most visitors read, explaining what it does and how to use it.
- file LICENSE The GNU GPL v3.0 license text. A strong copyleft license: anyone who distributes a modified or derivative version of the code must also release its source under this same license. A LICENSE file is what makes a repository's code legally reusable by others -- without one, the default under copyright law is "all rights reserved."
- file isEven.ts This file defines and exports an `isEven` function that takes a number argument and returns a boolean indicating whether the number is evenly divisible by two using the modulo operator.
- file isOdd.ts This file defines and exports a function `isOdd` that takes a numeric argument and returns a boolean indicating whether the given number is odd (i.e., not evenly divisible by 2).
- changeset changesets/cd5df1bcaf5439ea4b1e2c1d1987505151ad20b8 Initial commit: added README.md, LICENSE.
- filechange README.md Added. A README introducing the "shirt" repository -- torso and arm coverings, w/ buttons. A README is the front door of an open-source project: the first document most visitors read, explaining what it does and how to use it.
- filechange LICENSE Added. The GNU GPL v3.0 license text. A strong copyleft license: anyone who distributes a modified or derivative version of the code must also release its source under this same license. A LICENSE file is what makes a repository's code legally reusable by others -- without one, the default under copyright law is "all rights reserved."
- changeset changesets/12ed0fd36438752b4bfa10b20aae96df8ddc3dbe Added a new file `isEven.ts` containing the exported `isEven` function to check the evenness of a numeric input.
- filechange changesets/12ed0fd36438752b4bfa10b20aae96df8ddc3dbe/isEven.ts This file defines and exports an `isEven` function that takes a number argument and returns a boolean indicating whether the number is evenly divisible by two using the modulo operator.
- changeset changesets/cfd6a75d1832c5813d2a89b6713ac33c9ddf14cf Added a new file `isOdd.ts` implementing and exporting the `isOdd` function.
- filechange changesets/cfd6a75d1832c5813d2a89b6713ac33c9ddf14cf/isOdd.ts This file defines and exports a function `isOdd` that takes a numeric argument and returns a boolean indicating whether the given number is odd (i.e., not evenly divisible by 2).
- c6c8d3c5 test: add nested subdirectory files thoward37@gmail.com 2026-10-13T21:11:37.000Z
- cfd6a75d Add isOdd.ts with exported isOdd function zzmq.dev@gmail.com 2026-10-13T16:22:19.000Z
- 12ed0fd3 add isEven function in new file isEven.ts zzmq.dev@gmail.com 2026-10-13T16:15:55.000Z
- cd5df1bc initial commit zzmq 2026-10-13T10:21:22.000Z
- No Asks posted yet.
- lane-a8cd4252 proposed coord: thoward37@gmail.com